﻿@{
    Layout = null;
    var sellList = (List<SellItems>)ViewBag.SetSellItems;
    var adp = new DbContextAdapter();
    var productService = new ProductService(adp);
}
@using Super.DomainService
@using Super.Infrastructure
@model Stock
<div class="pageHeader" style="border: 1px #B8D0D6 solid">
    <div class="panel" defh="100">
        <form id="pagerForm">
        <h1>订单详情</h1>
        <div class="pageFormContent" id="stockList_Detial">
            @Html.HiddenFor(a => a.ID)
            <p><label>用户：</label> <input id="userId" name="user.ID" value="" type="hidden" />
             <input class="required" id="buyer" name="user.Name" type="text" suggestfields="ID,Name" suggesturl="/admin/user/subsearch" lookupgroup="user" lookuppk="ID" /> <a class="btnLook" href="/admin/user/subsearch" lookupgroup="user" lookuppk="ID">查找带回</a> </p>
             <div class="divider"></div>
            <p><label>总价：</label> <input type="text" value="@ViewBag.totalMoney" readonly="readonly"/> </p>
            @Html.DWZTextBox("Count", "产品数量").Required().Disable()
               <div class="divider"></div>
            <a class="button" href="/admin/pos/pay" target="dialog" id="posPay" rel="posPay" mask="true"><span>收款</span></a>

            <a class="button" href="/admin/pos/clear" target="ajaxTodo"><span>清空购物车</span></a>
        </div>
        </form>
    </div>
</div>
<div class="pageContent" style="border-left: 1px #B8D0D6 solid; border-right: 1px #B8D0D6 solid">
    <div class="panelBar">
        <ul class="toolBar">
            <li><a class="edit" href="/admin/pos/edit?id={sid_user}" target="dialog" rel="posEdit"><span>编辑</span></a></li>
        </ul>
    </div>
    <table class="table" width="99%" rel="jbsxBox_stock">
        <thead>
            <tr>
                <th width="120" align="center">名称</th>
                <th width="120" align="center">价格</th>
                <th width="120" align="center">数量</th>
            </tr>
        </thead>
        <tbody>
            @{
                if (sellList != null)
                {
                    foreach (var item in sellList)
                    {
                        
                <tr target="sid_user" rel="@item.StockId">
                    <td align="center">@item.ProductName</td>
                    <td align="center">@item.Price</td>
                    <td align="center">@item.Count</td>
                </tr>
    
                    }
                }
            }
        </tbody>
    </table>
</div>
<style type="text/css">
    #stockList_Detial p { width: 300px; }
    .gridScroller { height: 400px; }
</style>
<script type="text/javascript">
    $('#posPay').click(function () {
        var id = $('#userId').val();

        $.ajax({
            type: "POST",
            url: "/admin/pos/SetBuyer",
            data: "userId="+id,
            success: function (msg) {
               // alert("Data Saved: " + msg);
            }
        });
    });
</script>

